<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{padding: 0;margin: 0;}
        #box{
            width: 200px;
            height: 200px;
            background-color: #6ff;
            margin: 50px;
            text-align: center;
            line-height: 200px;
        }
    </style>
</head>
<body>  
    <!-- 获取标签内的属性 box.getAttribute("class")  -->
    <!-- 写在标签内 和 标签名以一个空格分隔 叫做属性(属性节点)  id="box" class="one two three" title="hello" -->
    <div id="box" class="one two three" title="hello" >
        <span>我是box</span>
    </div>
</body>
<script>
    var box = document.getElementById("box");
    console.dir(box);   // 打印一个对象或函数的详细属性和方法

    // 移入
    box.onmouseover = function(){
        console.log("划入box");
        this.style.backgroundColor =  "red";
    }

    // 移出
    box.onmouseout = function(){
        console.log("划出box");
        this.style.backgroundColor =  "#6ff";
    }



</script>
</html>